import 'package:demo202112/utils/common_appbar.dart';
import 'package:flutter/material.dart';

class WyInkwell extends StatefulWidget {
  @override
  _WyInkwellState createState() => _WyInkwellState();
}

class _WyInkwellState extends State<WyInkwell> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: getAppBar("WyInkwell"),
      body: ListView(
        children: [
          InkWell(
              child: Text('inwell点击效果'),
              onTap: () {
                print('------');
              }),
          SizedBox(
            height: 20,
          ),
          InkWell(
            onTap: () {},
            splashColor: Colors.red,
            child: Text('WyInkwell'),
          ),
          SizedBox(
            height: 20,
          ),
          InkWell(
            onTap: () {},
            child: Container(
              padding: EdgeInsets.symmetric(horizontal: 20, vertical: 8),
              decoration: BoxDecoration(
                  border: Border.all(color: Colors.blue),
                  borderRadius: BorderRadius.all(Radius.circular(30))),
              child: Text('这是InkWell点击效果'),
            ),
          ),
          SizedBox(
            height: 20,
          ),
          Ink(
            decoration: BoxDecoration(
              gradient: LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: [Color(0xFFDE2F21), Color(0xFFEC592F)]),
              borderRadius: BorderRadius.all(Radius.circular(20)),
            ),
            child: InkWell(child: Container(
              padding: EdgeInsets.symmetric(vertical: 8, horizontal: 20),
              child: Text(
                '这个是inwell的点击效果',
                style: TextStyle(color: Colors.white, fontSize: 28),
              ),
            ),
              onTap: (){

              },

            ),
          )
        ],
      ),
    );
  }
}
